package com.haojiu.controller;

import com.haojiu.pojo.Book;
import com.haojiu.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @author:我叫浩九
 * @date：2021/8/28 11:54
 * create in RuGao JiangSu
 */
@Controller
public class StatisticController {
    @Autowired
    private BookService bookService;

    @RequestMapping("/statisticIndex")
    public String statistics(Model model){
        //根据图书类型查询图书数量
        List<Book> list = bookService.getBookCountByType();
        model.addAttribute("list",list);
        return "count/statisticIndex";
    }
}
